Find the $3 \times 3$ matrix $\mathbf{M}$ such that for a $3 \times 3$ matrix $\mathbf{N},$ $\mathbf{M} \mathbf{N}$ is the result of swapping the first row and second row of $\mathbf{N},$ and doubling the third row of $\mathbf{N}.$  In other words,
\[\mathbf{M} \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} = \begin{pmatrix} d & e & f \\ a & b & c \\ 2g & 2h & 2i \end{pmatrix}.\]
Solution: Let $\mathbf{r}_1,$ $\mathbf{r}_2,$ $\mathbf{r}_3$ be the row vectors of $\mathbf{M},$ and let $\mathbf{c}_1,$ $\mathbf{c}_2,$ $\mathbf{c}_3$ be the column vectors of $\mathbf{N},$ so
\[\mathbf{M} \mathbf{N} = \begin{pmatrix} -\mathbf{r}_1- \\ -\mathbf{r}_2- \\ -\mathbf{r}_3- \end{pmatrix} \begin{pmatrix} | & | & | \\ \mathbf{c}_1 & \mathbf{c}_2 & \mathbf{c}_3 \\ | & | & | \end{pmatrix} = \begin{pmatrix} \mathbf{r}_1 \cdot \mathbf{c}_1 & \mathbf{r}_1 \cdot \mathbf{c}_2 & \mathbf{r}_1 \cdot \mathbf{c}_3 \\ \mathbf{r}_2 \cdot \mathbf{c}_1 & \mathbf{r}_2 \cdot \mathbf{c}_2 & \mathbf{r}_2 \cdot \mathbf{c}_3 \\ \mathbf{r}_3 \cdot \mathbf{c}_1 & \mathbf{r}_3 \cdot \mathbf{c}_2 & \mathbf{r}_3 \cdot \mathbf{c}_3 \end{pmatrix}.\]We want the first row of $\mathbf{MN}$ to be the second row of $\mathbf{N},$ which corresponds to the second entry of $\mathbf{c}_j$ for each $j.$  Thus, we can take $\mathbf{r}_1 = (0,1,0).$

Also, we want the second row of $\mathbf{MN}$ to be the first row of $\mathbf{N},$ which corresponds to the first entry of $\mathbf{c}_j$ for each $j.$  Thus, we can take $\mathbf{r}_2 = (1,0,0).$

Finally, we want the third row of $\mathbf{MN}$ to be double the third row of $\mathbf{N}.$   The elements in the third row of $\mathbf{N}$ correspond to the third entry of $\mathbf{c}_j$ for each $j.$  Thus, we can take $\mathbf{r}_3 = (0,0,2).$  Hence,
\[\mathbf{M} = \boxed{\begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 2 \end{pmatrix}}.\]